package ua.simplecoding.kievhome.domain;

import javax.persistence.*;
import java.io.Serializable;

@Entity
@Table(name = "appartment")
public class Appartment extends AbstractPrimaryEntity implements Serializable{

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "appartment_address_fk", referencedColumnName = "pk")
    private AppartmentAddress appartmentAddress;

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "appartment_details_fk", referencedColumnName = "pk")
    private AppartmentDetails appartmentDetails;

    public Appartment(int id) {
        super(id);
    }

    public Appartment() {
    }

    public AppartmentDetails getAppartmentDetails() {
        return appartmentDetails;
    }

    public void setAppartmentDetails(AppartmentDetails appartmentDetails) {
        this.appartmentDetails = appartmentDetails;
    }

    public AppartmentAddress getAppartmentAddress() {
        return appartmentAddress;
    }

    public void setAppartmentAddress(AppartmentAddress appartmentAddress) {
        this.appartmentAddress = appartmentAddress;
    }
}